<?php

/** Soooner_View_Template */
require_once ROOT_PATH . '/library/Soooner/View/Template.php';
/** Soooner_Controller_Acl */
//require_once ROOT_PATH . '/library/Soooner/Controller/Acl.php';

class Soooner_Web_Controller_Action extends Zend_Controller_Action
{
    protected $_configs;

    /**
     * 模板参数信息
     * @var array
     */
    protected $_dzTemplate = array();

    /**
     * 构造方法
     * @return void
     */
    public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array())
    {
        parent::__construct($request, $response, $invokeArgs);
        $this->_configs=$this->getConfig();
    }
    public function initDzTemplate()
    {
        $this->_dzTemplate = new Soooner_View_Template();
    }
    function getConfig()//获取配置信息
    {
    	$db = Zend_Db_Table::getDefaultAdapter();
    	$configrows = $db->fetchAll("select configname, configvalue from config");//获取配置信息
        $configs = array();
    	if (!empty($configrows)){
	       foreach ($configrows as $item){
	          $configs[$item['configname']] = $item['configvalue'];}
    	}//配置信息获取完成
    	return $configs;
    }
}
